package org.code.util;

import java.io.IOException;

/**
 * @author xiao
 * <p>
 * 线程工具类
 */
public final class ThreadUtil {

    /**
     * 获取当前线程名称
     *
     * @return 当前线程名称
     */
    public static String getCurrentThreadName() {
        return Thread.currentThread().getName();
    }

    /**
     * 获取当前线程ID
     *
     * @return 前线程ID
     */
    public static long getCurrentThreadId() {
        return Thread.currentThread().getId();
    }

    /**
     * 阻塞当前线程
     *
     * @throws IOException IO异常
     */
    public static void read() throws IOException {
        System.in.read();
    }
}
